<link rel="stylesheet" type="text/css" href="/static/js/artdialog/skins/brief.css?4.1.7">
<script src="/static/js/artdialog/artDialog.js?skin=brief"></script>
{js href="/static/js/artdialog/plugins/iframeTools.js"}
{css href="/static/js/form/style.css"}
{js href="/static/js/form/form.js"}
<form action="" method="post">
    <div class="tools_bar clearfix">
        <a class="icon-checkbox-checked icon-checkbox-unchecked" href="javascript:;" onclick="tools_select('id[]',this)" title="全选" data="true"> 全选 </a>
        <a class="icon-remove-2" href="javascript:;" onclick="tools_submit({action:'{:url(\'customer_del\')}',msg:'删除后无法恢复，你真的删除吗？'})" title="删除"> 删除</a>
        <a href="{:url('customer_edit')}" class="icon-plus"> 添加</a>
        <a class="icon-delicious" href="{:url('customer_list')}"> 全部用户</a>
        <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style="" > 筛选条件</a><input id="condition_input" type="hidden" name="condition" value="{$condition}"></span>
    </div>
    <table class="default">
        <tr>
            <th style="width:30px">选择</th>
            <th style="width:70px">操作</th>
            <th style="width:100px">真实姓名</th>
            <th style="width:60px">性别</th>
            <th style="width:60px">积分</th>
            <th style="width:80px">消费金额</th>
            <th style="width:100px">联系电话</th>
            <th style="width:130px">添加时间</th>
        </tr>
        {volist name="customerList" id="customer"}
            <tr>
                <td style="width:30px">
                    <input type="checkbox" name="id[]" value="{$customer['id']}">
                </td>
                <td style="width:70px" class="btn_min">
                    <div class="operat hidden"><a class="icon-cog action" href="javascript:;"> 处理</a>
                        <div class="menu_select">
                            <ul>
                                <li><a class="icon-pencil" href="{:url('customer_edit', ['id' => $customer['id']])}"> 编辑</a></li>
                                <li><a class="icon-remove-2" href="javascript:confirm_action('{:url(\'customer_del\', [\'id\' => $customer[\'id\']])}')"> 删除</a></li>
                                <li><a class="icon-remove-2" href="javascript:;" onclick="view('{:url(\'admin/jf_detail\', [\'id\' => $customer[\'id\']])}')"> 积分详情</a></li>
                                <li><a class="icon-remove-2" href="javascript:;" onclick="jifen_op({$customer['id']}, 'add', '增加积分', '{$customer[\'real_name\']}')"> 增加积分</a></li>
                                <li><a class="icon-remove-2" href="javascript:;" onclick="jifen_op({$customer['id']}, 'cut', '减少积分', '{$customer[\'real_name\']}')"> 减少积分</a></li>
                            </ul>
                        </div>
                    </div>
                </td>
                <td style="width:100px">{$customer['real_name']}</td>
                <td style="width:60px">{if condition="$customer['sex'] == 0"}女{else/}男{/if}</td>
                <td style="width:60px">{$customer['point']}</td>
                <td style="width:80px">{$customer['balance']}</td>
                <td style="width:130px">{$customer['mobile']}</td>
                <td style="width:100px">{$customer['reg_time']}</td>
            </tr>
        {/volist}
    </table>
</form>
<div class="page_nav">
    {$customerList->render()}
</div>
<div id="status_dialog" style="display: none; position: relative;" class="form2">
    <form class="form2" action="{:url('admin/customer_jf')}" method="post">
        <input type="hidden" name="id" id="customer_id" value="">
        <input type="hidden" name="status" id="jf_op_type" value="">
        <input type="hidden" name="real_name" id="jf_real_name" value="">
        <dl class="lineD">
            <dt>积分：</dt>
            <dd>
                <input name="point" type="text" class="small" pattern="int" alt="请输入正确的积分">
                <label></label>
            </dd>
        </dl>
        <dl class="lineD">
            <dt>备注信息：</dt>
            <dd>
                <textarea id="order_remark" name="remark"></textarea>
                <label></label>
            </dd>
        </dl>
        <div class="alone_order_footer tc">
            <button class="focus_button" onclick="">保存</button>
        </div>
    </form>
</div>
<script type="text/javascript">
var form = new Form();
$('#condition').on('click', function() {
    $('body').Condition({
        input: '#condition_input',
        okVal: '高级搜索',
        callback: function(data) { tools_submit({ action: "{:url('customer_list')}", method: 'get' }); },
        data: {
            real_name: {
                name: '真实姓名'
            },
            mobile: {
                name: '手机号码'
            },
            sex: {
                name: '性别',
                values: {
                    0: '女',
                    1: '男'
                }
            },
            balance: {
                name: '消费金额'
            }
        }
    });
});

function jifen_op(id, type, title, real_name) {
    $('#customer_id').val(id);
    $('#jf_op_type').val(type);
    $('#jf_real_name').val(real_name);
    art.dialog({ id: 'status_dialog', title: title, resize: false, width: 500, height: 200, padding: '0 5px', content: document.getElementById('status_dialog') });
}

function view(url) {
    art.dialog.open(url, { id: 'view_dialog', title: '查看积分详情', resize: false, width: 1800, height: 900 });
}
</script>